<!DOCTYPE html>
<html>
<head>
<meta content='text/html;charset=utf-8' http-equiv='content-type'>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<script type="text/javascript" src="gallery/handlebars/2.0.0/handlebars.js"></script>
<script type="text/javascript" src="jquery/jquery/jquery.js"></script>
<script id="seajsnode" type="text/javascript" src="seajs/seajs/2.2.1/sea.js"></script>
</head>
<style type="text/css">	
	.label{
		padding: 5px;
		width:15%;
	}
	.value{
		width:35%;
		padding: 5px;
	}
	#footer{
		margin: 10px;
	}
	table#moneyList tr td{
		padding:5px;
	}	
</style>
<body style='margin: 0px;padding: 0px;'>
	<div><img src="../assets/eling/theme/yhy/printlogo.png"></div>
	<div id="bs-example-navbar-collapse-1"></div>
	<script type="text/x-handlebars-template" id="template">
		<div style='width:90%;margin: auto;padding-top: 10px;'>
			<div>
				<table align='left' style='width:100%'>
					<tr>
                		<td><font size='2' face='黑体'>{{organization}}</font></td>
            		</tr>
					<tr>
                		<td colspan = "3"><hr style='border:1px solid; width:100%;'/></td>
            		</tr>
					<tr>
                		<td style='padding-left:40px'><font size='1' face="黑体">姓名:{{name}}</font></td>
                		<td><font size='1' face="黑体">身份证号:{{idNumber}}</font></td>
                		<td><font size='1' face="黑体">权证号:{{contractNumber}}</font></td>
            		</tr>
					<tr>
                		<td style='padding-left:40px'><font size='1' face="黑体">入住日期:{{checkInDate}}</font></td>
                		<td><font size='1' face="黑体">退住日期:{{checkOutDate}}</font></td>
                		<td><font size='1' face="黑体">入住天数:{{liveDays}}</font></td>
            		</tr>
					<tr>
                		<td style='padding-left:40px'><font size='1' face="黑体">房间号:{{roomCode}}</font></td>
                		<td><font size='1' face="黑体">房型:{{roomType}}</font></td>
                		<td><font size='1' face="黑体"></font></td>
            		</tr>
					<tr>
						<td colspan = "3"><hr style='border:1px solid; width:100%;'/></td>
					</tr>
    			</table>
			</div>
    		<div>
					<table id="moneyList" style='width:100%;border-collapse:collapse;' border='1'>
						<thead>
							<tr>
                				<td width="50%"><font size='1' face="黑体">项目</font></td>
                				<td width="50%"><font size='1' face="黑体">金额</font></td>
            				</tr>
						</thead>
						<tbody>						
						{{#each this.moneyList}}
						<tr>
							<td width="50%"><font size='1' face="黑体">{{project}}</font></td>
							<td width="50%"><font size='1' face="黑体">{{money}}元</font></td>
						</tr>
						{{/each}}
						</tbody>
						<tfoot>
							<tr>
								<td width="50%">
									<p><font size='1' face="黑体">地址：千岛湖镇淳杨线港口路666-668号</font></p>
									<p><font size='1' face="黑体">电话：0571-24829999</font></p>
									<p><font size='1' face="黑体">开户行：建行淳安支行（基本户）</font></p>
									<p><font size='1' face="黑体">账号：33050161763509888666</font></p>
								</td>
								<td width="50%">
									<p><font size='1' face="黑体">本人已查看并且上述金额无误，如转账无效，本人愿意承担账单所列未清及最后欠额。</font></p>
									<p><font size='1' face="黑体">签署人：</font></p>
									<p><font size='1' face="黑体">电话：</font></p>
								</td>
							</tr>
						</tfoot>	
					</table>
    		</div>
   		    <div id="footer">
				<table>
					<tr>
						<td class="label">经办人：</td>
						<td class="value"><span id="operatorName">{{operatorName}}</span></td>
						<td class="label">结算日期：</td>
						<td class="value"><span id="statementDate">{{settlementDate}}</span></td>
					</tr>
				</table>
			</div>
		</div>
	</script>
	<!-- 	
			打印暂时去掉备注
			<td align='center' style='width:40%;'><font style='' size='1' face="黑体">备注</font></td>
			<td align='left' style='width:40%;'><font style='padding-left:26%' size='1' face="黑体">{{remak}}</font></td>
	 -->
	<script type="text/javascript">
        $(function(){
        	var thisURL = decodeURIComponent(document.URL); 
			var sp0 = thisURL.split("?")[1];  
			var list = sp0.split("&");
			var map = {};
			
			for(var i=0;i<list.length;i++){
				var key = list[i].split("=")[0];
				var value = list[i].split("=")[1];
				map[key] = value;
			}
			
			map["moneyList"] = JSON.parse(map.moneyList)
			
			var template = $("#template").text();
			$("#bs-example-navbar-collapse-1").html(Handlebars.compile(template)(map));
			$("td").each(function(){
				if($(this).text() == "结算金额" || $(this).text() == "收费合计"){
					$(this).find("font").attr("size", "4");
					$(this).next().find("font").attr("size", "4");
				}
			})
			window.print(); 
		});
    </script>
</body>
</html>